package com.zzj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zzj.bean.TabFlower;
import com.zzj.dao.TabFlowerMapper;
import com.zzj.service.TabFlowerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * InnoDB free: 8192 kB 服务实现类
 * </p>
 *
 * @author 花
 * @since 2022-03-04
 */
@Service
public class TabFlowerServiceImpl extends ServiceImpl<TabFlowerMapper, TabFlower> implements TabFlowerService {

    @Resource
    private TabFlowerMapper tabFlowerMapper;


    @Override
    public PageInfo<TabFlower> findAll(Integer pageNum,Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<TabFlower> list =tabFlowerMapper.findAll();
        PageInfo<TabFlower> info =new PageInfo<>(list);
        return info;
    }

    @Override
    public TabFlower findOneById(String fid) {

        return tabFlowerMapper.findOneById(fid);
    }

    @Override
    public PageInfo<TabFlower> getFlowerByLike(int pageNum, int pageSize, String column, String val) {
        PageHelper.startPage(pageNum,pageSize);
        List<TabFlower> list = tabFlowerMapper.getFlowerByLike(column, val);
        return new PageInfo<>(list);
    }


}
